import type { IModelConfig } from '@/components/page-model/type'

const modelConfig: IModelConfig = {
  title: {
    addNewTitle: '新增账号',
    editTitle: '编辑账号',
  },
  formItems: [
    {
      type: 'input',
      prop: 'username',
      label: '登录账号',
      placeholder: '请输入登录账号'
    },
    {
      type: 'select',
      prop: 'roleId',
      label: '角色',
      placeholder: '请选择角色',
      options: []
    },
    {
      type: 'input',
      prop: 'password',
      label: '密码',
      placeholder: '请输入密码'
    },
  ],
  rules: {
    username: [{ required: true, message: '必须输入登录账号', trigger: 'blur' }],
    role_id: [{ required: true, message: '必须选择角色', trigger: 'change' }],
    password: [{ required: true, message: '必须输入密码', trigger: 'blur' }],
  }
}

export default modelConfig
